Skip to content

Conversation

@Shahzaibyy
Copy link
Contributor

researched issue #1542 and found that Notion MCP schemas exceed the default JSON depth limit. Here's what I implemented:

Solution:

  1. Increased depth limit: Default from 10 → 30, configurable via VALIDATION_MAX_JSON_DEPTH
  2. Better error handling: Per-tool validation with logging instead of silent failures
  3. User-friendly OAuth errors: Clear messages when validation fails during OAuth flows

Result: Users will now see helpful error messages instead of "unhandled errors in TaskGroup", and Notion MCP should work out-of-the-box.

Looking forward to your review of these changes!

@crivetimihai crivetimihai force-pushed the fix/1542-oauth-validation-logs branch from 66fcaba to 1abe893 Compare December 13, 2025 01:39
Copy link
Member

@crivetimihai crivetimihai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased

… limit

- Increase default validation_max_json_depth from 10 to 30 for
  compatibility with deeply nested schemas (e.g., Notion MCP)
- Add VALIDATION_MAX_JSON_DEPTH environment variable for configuration
- Add _validate_tools method for per-tool validation with detailed
  error logging instead of silent failures
- Add OAuthToolValidationError for OAuth-specific validation failures
- Provide helpful error messages suggesting depth limit increase
- Add exclude_unset=True to model_dump to prevent validation issues

Users will now see actionable error messages instead of generic
"unhandled errors in TaskGroup" when tool validation fails.

Closes IBM#1542

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai force-pushed the fix/1542-oauth-validation-logs branch from 1abe893 to fa26192 Compare December 13, 2025 10:49
@crivetimihai crivetimihai merged commit cbcab24 into IBM:main Dec 13, 2025
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants